package van.planifolia.template;

/**
 * Created by Intellij IDEA<br>
 *
 * @author Planifolia.Van
 * @version 1.0
 * @date 2022/11/10 16:44
 */
public class Circle implements ShapeTemp {
    /**
     * ⚪的半径
     */
    int r;

    public Circle(int r) {
        this.r = r;
    }

    @Override
    public double area() {
        System.out.println("圆的面积为" + Math.PI * r * r);
        return Math.PI * r * r;
    }

    @Override
    public double perimeter() {
        System.out.println("圆的周长为" + Math.PI * 2 * r);
        return Math.PI * 2 * r;
    }
}
